package com.tracker.session;

import java.util.Set;

import com.tracker.bean.Device;
import com.tracker.dao.DeviceDAO;


public class DeviceSession {
		private DeviceDAO deviceDAO = new DeviceDAO();
		
        public void add(Device device) throws Exception{
        	deviceDAO.persist(device);
        }

        public Set<Device> list(Device device) throws Exception{
        	return deviceDAO.getListObject(device);
        }

        public Device get(Device device) throws Exception{
        	return deviceDAO.getObjectByKey(device.getImei());
        }
        
        public void delete(Device device) throws Exception{
        	deviceDAO.delete(device.getImei());
        }
        
}